@echo off
echo 测试Java版本的完整自动化流程
echo ================================

echo.
echo 1. 启动Chrome调试模式...
start-chrome-debug.bat

echo.
echo 等待5秒让Chrome启动...
timeout /t 5 /nobreak > nul

echo.
echo 2. 启动Java后端服务...
cd backend
start "Java Backend" cmd /k "mvn spring-boot:run"

echo.
echo 等待10秒让后端服务启动...
timeout /t 10 /nobreak > nul

echo.
echo 3. 测试API端点...

echo.
echo 测试健康检查...
curl -X GET http://localhost:8080/api/analysis/health

echo.
echo.
echo 测试浏览器初始化...
curl -X POST http://localhost:8080/api/analysis/browser/init

echo.
echo.
echo 测试完整自动化流程...
curl -X POST http://localhost:8080/api/analysis/automation/full ^
  -H "Content-Type: application/json" ^
  -d "{\"username\":\"your_username\",\"password\":\"your_password\",\"deviceSn\":\"714052411550289190\",\"phone\":\"13344445555\"}"

echo.
echo.
echo 测试完成！请查看浏览器窗口和日志输出。
echo.
echo 按任意键关闭...
pause > nul
